import request from "@/utils/request";

//新增接口
export const addWorkOrder = (data) => {
  return request({
    url: "prod/workOrder",
    method: "post",
    data,
  });
};
//编辑接口
export const updateWorkOrder = (data) => {
  return request({
    url: "prod/workOrder",
    method: "put",
    data,
  });
};
//查询接口
export const listWorkOrder = (params) => {
  return request({
    url: "prod/workOrder/list",
    method: "get",
    params,
  });
};

// 查询生产订单
export function listOrder(params) {
  return request({
    url: 'prod/order/list',
    method: 'get',
    params
  })
}

//查询接口
export const getOrderList = (params) => {
  return request({
    url: "prod/order/list",
    method: "get",
    params,
  });
};
//删除接口
export const delWorkOrder = (ids) => {
  return request({
    url: `prod/workOrder/${ids}`,
    method: "delete",
  });
};
//数据回显接口
export const getWorkOrder = (id) => {
  return request({
    url: `prod/workOrder/${id}`,
    method: "get",
  });
};

//查询历史接口
export const historyList = (params) => {
  return request({
    url: "prod/workOrder/historyList",
    method: "get",
    params,
  });
};

// //编辑时-查询生产工单列表
// export const listWorkOrder = (params) => {
//   return request({
//     url: "prod/workOrder/list",
//     method: "get",
//     params,
//   });
// };